//
//  AppDelegate.swift
//  HinsLive
//
//  Created by haoxian on 2019/4/15.
//  Copyright © 2019 Hins. All rights reserved.
//

import UIKit
import IQKeyboardManagerSwift


@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        
        config()
        setupRootViewController()
        return true
    }
}

private extension AppDelegate {
    func config() {
        IQKeyboardManager.shared.enable = true
        IQKeyboardManager.shared.shouldResignOnTouchOutside = true
        AccountManager.share.load()
        Network.startNetworkChangeNotification()
    }
    
    func setupRootViewController() {
        window = UIWindow(frame: UIScreen.main.bounds)
        window?.makeKeyAndVisible()
        window?.rootViewController = MainTabBarController()
    }
}
